from requests_html import HTMLSession
import pyperclip
# 获取请求对象
session = HTMLSession()
url = pyperclip.paste()
# 往网站发送get请求
page = session.get(url)
page.encoding = 'utf-8'
# （掘金酱https://e.juejin.cn/#/）远程主机强迫关闭了一个现有的连接。
# page.html.render()
content = page.html.find('div.mainContent', first=True)
a_s = content.find('a')
for a in a_s:
    href = a.attrs['href']
    print('href ', href)
    _page = session.get(href)
    _page.encoding = 'utf-8'
    print(_page.html.find('h1#articleContentId', first=True).text)
    c = _page.html.find('h1#articleContentId')